
import request from "@/request/request.js"
import getRequestUrl from '../request/getRequestUrl.js';
let server_url = getRequestUrl.requestUrl;
let isRequ = server_url.indexOf('pre') !== -1
const isProduction = import.meta.env.NODE_ENV === 'production'
// 提交前端日志 生产和预发都不进行上报
export function postLog(params) {
	if(!isProduction || isRequ) return
	console.log('请求了')
	const userInfo = uni.getStorageSync("currUser");
	return request({
		url: `/node/log/log/writeError`,
		method: "POST",
		params:{
            errorInfo: JSON.stringify(params),
            userInfo: JSON.stringify(userInfo || {})
        }
	});
}